﻿using System;
using Common.Enums;

namespace Common.Attributes
{
    /// <summary>
    /// 扩展JSON属性特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class ExtJsonAttribute : Attribute
    {
        /// <summary>
        /// 扩展JSON类型
        /// </summary>
        public ExtJsonEnum Type { get; set; } = ExtJsonEnum.Dict;

        /// <summary>
        /// 父编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 枚举类型
        /// </summary>
        public Type EnumType { get; set; }

        /// <summary>
        /// 生成的JSON属性名称
        /// </summary>
        public string PropertyName { get; set; }
        //
        // /// <summary>
        // /// 构造函数
        // /// </summary>
        // /// <param name="code">编码</param>
        // public ExtJsonAttribute(string code = "")
        // {
        //     Code = code;
        // }
    }
}